{% extends "qa_base.html" %}
{% block content %}
<div id="wrapper">
    {% if query %}
    <div id="room">	
	        <div id="CALeft">
			    <div class="tabBar">
				    <div class="headQuestions">questions matching &#39;{{ query|escape }}&#39;</div> 
                    <a class="feed-icon" style="background-image:url('/image/feed-icon-small.png');" href="/search/?type=rss&amp;q&amp;=&amp;%&amp;E&amp;6&amp;%&amp;A&amp;8&amp;%&amp;A&amp;1&amp;%&amp;E&amp;5&amp;%&amp;9&amp;E&amp;%&amp;8&amp;B&amp;&amp;&amp;t&amp;=&amp;q&amp;u&amp;e&amp;s&amp;t&amp;i&amp;o&amp;n&amp;&amp;&amp;S&amp;u&amp;b&amp;m&amp;i&amp;t&amp;=&amp;%&amp;E&amp;6&amp;%&amp;9&amp;0&amp;%&amp;9&amp;C&amp;%&amp;E&amp;7&amp;%&amp;B&amp;4&amp;%&amp;A&amp;2" title="subscribe to question RSS feed"></a>
                    <div class="tabsA">
                    <!--not complete yet-->
        	            <a href="/qa/search/?q={{ query|escape }}&amp;t=question&amp;Submit=搜索&sort=effective" class="on" title="Most recently updated questions">有效</a>
        	            <a href="/qa/search/?q={{ query|escape }}&amp;t=question&amp;Submit=搜索&sort=newest_question" title="most recently asked questions">最新问题</a>
        	            <a href="/qa/search/?q={{ query|escape }}&amp;t=question&amp;Submit=搜索&sort=hot_question" title="most active questions in the last 24 hours">热门问题</a>
        	            <a href="/qa/search/?q={{ query|escape }}&amp;t=question&amp;Submit=搜索&sort=mostvoted" title="most voted questions">最有价值的问题</a>
                    </div>
                </div>
                <div id="listA">
                    {% if not results %}
                    <p> no questions </p>
                    {% endif %}
    	            {% if results %}
      	                {% for question in results %}	   
				            <div class="short-summary">
    			                <div class="counts">
        			                <div class="votes">
            		                    <div class="item-count">{{question.vote_count}}</div>
            		                    <div>vote</div>
            	                    </div>
        		                    <div class="status  answered">
            		                    <div class="item-count">{{question.answered_count}}</div>
            		                    <div>回答</div>
            	                    </div>
        			                <div class="views">
            		                    <div class="item-count">{{question.view_count}}</div>
             		                    <div>浏览</div>
        			                </div>
        	                    </div>
    			                <div class="question-summary-wrapper">
        			                <h2><a title = "{{question.description}}" href="/qa/questions/{{question.id}}/">{{question.title}}</a></h2>
        			                <div class="userinfo">
                                    {% for lastanswer in lastanswerlist %}
                                        {% if forloop.parentloop.counter0 == forloop.counter0 %}
            		                    <span class="relativetime" title="{{lastanswer.answer_datetime}}">{{lastanswer.answer_datetime}}</span>
                                        <!--not complete yet-->
            		                    <a href="/users/195/gastlygem/">{{lastanswer.answerer.name}}</a>
            		                    <span class="score" title="1591 积分"><span class="">1.6k</span></span>
                                        {% endif %}
                                    {% endfor %}
							        </div>
        			                <div class="tags">
                                    {% for tag in question.tags.all %}
                                    <!--not complete yet-->
            		                    <a class="tag-link-{{tag.name}}" href="/qa/tags/{{tag.name}}/" title="查看有关 '{{tag.name}}'" rel="tag">{{tag.name}}</a>
                                    {% endfor %}
        			                </div>
    			                </div>
				            </div>
                        {% endfor %}
                    {% endif %}
			    </div>
		    </div>
		    <div id="CARight">     
    	        <div class="boxC">
    		        <div class="questions-count">{{ resultscount }}
    			        <span style="color:black;font-size:14px;margin-left:5px">questions matching &#39;{{ query|escape }}&#39;</span>
    		        </div>
    		        <div class="questions-count">{{ answerscount }}
    			        <span style="color:black;font-size:14px;margin-left:5px">回答</span>
    		        </div>
    		        <div>
    			        <p class="nomargin">Most <strong>recently updated</strong> questions</p>
    		        </div>
    	        </div>
    	        <div class="boxC">
                    <h3 class="subtitle">相关标签</h3>
                    <div class="tags" id="recent-tags">
        	            {% for tag in tags %}
                            {% for tagcount in tagscount %}
                                {% if forloop.parentloop.counter0 == forloop.counter0 %}
                                <a rel="tag" class="tag-link-{{tag.name}}" title="see questions tagged '{{tag.name}}'"  href="/qa/tags/{{tag.name}}/">{{tag.name}}</a>
                                <span class="tag-number">&#215; {{ tagcount }}</span>
                                <br /
                                {% endif %}
                            {% endfor %}
                        {% endfor %}
                    </div>
    	        </div>
            </div>
            <div id="tail" style="clear:both;">      
    	<div class="pager"></div>
    	<div class="pagesize">
    		<div class="paginator">
    			<span class="text">每页显示：</span>
    			<span class="page"><a href="/search/?q=%E6%A8%A1%E5%9E%8B&amp;t=question&amp;Submit=%E6%90%9C%E7%B4%A2&sort=有效&pagesize=15">15</a></span>
    			<span class="curr">30</span>
    			<span class="page"><a href="/search/?q=%E6%A8%A1%E5%9E%8B&amp;t=question&amp;Submit=%E6%90%9C%E7%B4%A2&sort=有效&pagesize=50">50</a></span>
    		</div>
    	</div>
    </div>
    </div>
    <div class="spacer3"></div>
    {% endif %}
</div>
{% endblock %}
